#include <iostream>
#include <vector>
#include <map>

using namespace std;

vector<int> twoSum(vector<int> &nums, int target)
{
        map<int, int> a;
        vector<int> b(2, -1);
        for (int i = 0; i < nums.size(); i++)
                a.insert(map<int, int>::value_type(nums[i], i));
        for (int i = 0; i < nums.size(); i++)
        {
                if (a.count(target - nums[i]) > 0 && (a[target - nums[i]] != i))
                {
                        b[0] = i;
                        b[1] = a[target - nums[i]];
                        break;
                }
        }
        return b;
}

int main()
{
        vector<int> ret = twoSum({1, 2, 3, 4, 5}, 6); 
        return 0; 
}